<extend name="Public/base" />

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>提现列表</h2>
	</div>
	<div class="cf">
		<div class="fl">
            <!--<a class="btn" href="{:U('futures/add')}">新 增</a>-->
        <!--    <button class="btn ajax-post confirm" url="{:U('futures_order/delete',array('method'=>'deleteUser'))}" target-form="ids">删 除</button>-->
        <button class="sch-btn btn" id="search_two" url="{:U('download')}">导出</button>
            <span style = "width:200px;display:inline-block">提现金额：<i style = "color:red">{$tixian}</i> 元</span>
            <span style = "width:130px;display:inline-block">手续费：<i style = "color:red">{$shouxu}</i> 元</span>
        </div>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <select name="is_pay" id="is_pay">
                    <option value="-2" <if condition="$is_pay eq -2">selected</if>  style="width:200px">状态选择</option>
                    <option value="2" <if condition="$is_pay eq 2">selected</if>  style="width:200px">已退回</option>
                    <option value="1" <if condition="$is_pay eq 1">selected</if>  style="width:200px">已确认</option>
                    <option value="3" <if condition="$is_pay eq 3">selected</if>  style="width:200px">等待提现</option>
                </select>
            </div>
            <div class="sleft">
                <input type="text" name="uname" class="search-input" value="{:I('uname')}" placeholder="用户">
            </div>
						<div class="sleft">
                <input type="text" name="mobile" class="search-input" value="{:I('mobile')}" placeholder="用户电话">
            </div>
            <div class="sleft">
                <input type="text" name="id_card" class="search-input" value="{:I('id_card')}" placeholder="身份证">
            </div>
             <div class="sleft">
                <input type="text" name="bank_card" class="search-input" value="{:I('bank_card')}" placeholder="卡号">
            </div>
            <div class="sleft">
                <input type="text" id="start_time" name="start_time"  class="search-input" value="{:I('start_time')}" placeholder="提现开始时间">
            </div>
            <div class="sleft">
                <input type="text" id="end_time" name="end_time"  class="search-input" value="{:I('end_time')}" placeholder="提现结束时间">
            </div>
            <div class="sleft">
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('index')}"><i class="btn-search"></i></a>
            </div>
        </div>

    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
	<table class="">
    <thead>
        <tr>
		<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
		<th class="">ID</th>
		<th class="">用户</th>
		<th class="">身份证</th>
    <th class="">提现金额</th>
    <th class="">剩余冻结资金</th>
    <th class="">手续费</th>
    <th class="">银行卡</th>
    <th class="">持卡人</th>
    <th class="">银行卡号</th>
		<th class="">用户电话</th>
    <th class="">省份</th>
    <th class="">城市</th>
    <th class="">支行</th>
    <th class="">商户单号</th>
    <th class="">微信单号</th>
		<th class="">备注</th>
		<th class="">操作时间</th>
		<th class="">提现时间</th>
        <th class="" style="width:150px;">操作(确认/退回)</th>
		</tr>
    </thead>
    <tbody>
		<notempty name="list">
		<volist name="list" id="vo">
		<tr>
      <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
			<td>{$vo.id}</td>
			<td>{$vo.nickname}</td>
			<td>{$vo.id_card}</td>
			<td>{$vo.money}<span>元</span></td>
			<td>{$vo.blocked_fund}<span>元</span></td>
			<td>{$vo.handling_fee}<span>元</span></td>
			<td>{$vo.bank_name}</td>
			<td>{$vo.bank_realname}</td>
			<td>{$vo.bank_card}</td>
			<td>{$vo.mobile}</td>
			<td>{$vo.pro_name}</td>
			<td>{$vo.city_name}</td>
			<td>{$vo.outlets_name}</td>
      <td>{$vo.partner_trade_no}</td>
      <td>{$vo.payment_no}</td>
			<td>{$vo.remark}</td>
      <td>{$vo.pay_time|time_format}</td>
      <td>{$vo.add_time|time_format}</td>
			<td>
				<if condition="$vo['is_pay'] == 2">
					已退回
				<else/>
					<if condition="$vo['is_pay'] == 1">
						已确认
					<else/>
							<a href="{:U('FuturesDraw/draw_status?id='.$vo['id'])}">确认</a><br>
			        <a href="{:U('FuturesDraw/draw_return?id='.$vo['id'])}">退回</a><br>
		          <a href="{:U('ComPay/index?id='.$vo['id'])}">企业付款</a><br>
		      </if>
				</if>
    </td>
		</tr>
		</volist>
		<else/>
		<td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table>
	</div>
    <div class="page">
        {$page}
    </div>
</block>

<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js?v={:SITE_VERSION}" charset="UTF-8"></script>
	<script src="__STATIC__/thinkbox/jquery.thinkbox.js?v={:SITE_VERSION}"></script>
	<script type="text/javascript">
	 $('#start_time,#end_time,#create_time').datetimepicker({
            format: 'yyyy-mm-dd',
            language:"zh-CN",
            minView:2,
            autoclose:true,
        });
	 //搜索功能
        $("#search").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('input').serialize();
            var is_pay=$('#is_pay').val();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            query+="&is_pay="+is_pay;
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            //alert(url);
            window.location.href = url;
        });
        //搜索功能
        $("#search_two").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('input').serialize();
            var is_pay=$('#is_pay').val();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            query+="&is_pay="+is_pay;
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            //alert(url);
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });
    //导航高亮
    $('.side-sub-menu').find('a[href="{:U('FuturesDraw/index')}"]').closest('li').addClass('current');
	</script>
</block>
